package com.zsrt.javase.c003.t04.p01;

public class Test {
	public static String translate(String str){//对传入的str字符串进行转换
		String tempStr = "";
		try{
		    tempStr = new String(str.getBytes("ISO-8859-1"), "GBK");//把"ISO-8859-1"转化为“GBK”编码
		tempStr = tempStr.trim();
		}catch (Exception e){
		System.err.println(e.getMessage());
		}
		return tempStr;
		}


	public static void main(String[] args) {
		String aString ="只能";
		String translate = translate(aString);
		System.out.println(translate);

	}

}
